
<div class="main-content">
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="{:url('type/index')}">首页</a>
            </li>

            <li>
                <a href="#">栏目管理</a>
            </li>
            <li class="active">栏目分类</li>
        </ul><!-- .breadcrumb -->

        <div class="nav-search" id="nav-search">
            <form class="form-search">
								<span class="input-icon">
									<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
									<i class="icon-search nav-search-icon"></i>
								</span>
            </form>
        </div><!-- #nav-search -->
    </div>

    <div class="page-content">
        <div class="page-header">
            <h1>
                Banner管理
                <small>
                    <i class="icon-double-angle-right"></i>
                    Banner列表
                </small>
            </h1>
        </div><!-- /.page-header -->

        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <p>
                    <button class="btn btn-danger btn-block" onclick="urlTo();">添加banner
                    </button>
                </p>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="table-responsive">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th class="center">
                                        <label>
                                            <input type="checkbox" class="ace" />
                                            <span class="lbl"></span>
                                        </label>
                                    </th>
                                    <th>Id</th>
                                    <th>banner名称</th>
                                    <th>banner图片</th>
                                    <th>添加日期</th>
                                    <th>是否显示</th>
                                    <th>操作</th>
                                </tr>
                                </thead>

                                <tbody>
                                {foreach name="list" item="vo"}
                                <tr>
                                    <td class="center">
                                        <label>
                                            <input type="checkbox" class="ace" />
                                            <span class="lbl"></span>
                                        </label>
                                    </td>
                                    <td>
                                        <a href="#">{$vo.id}</a>
                                    </td>
                                    <td>{$vo.pic_name}</td>
                                    <td><img src="__PUBLIC__uploads/{$vo.pic_url}" width="100px" height="50px"/></td>
                                    <td class="hidden-480">{$vo['addtime']}</td>
                                    <td>
                                        <div class="col-xs-3">
                                            <label>
                                                <input name="switch-field-1" class="ace ace-switch ace-switch-6" sx="{$vo.is_show}" onclick="changeValue(this,{$vo.id})"
                                                       {if condition="$vo.is_show eq 0"} checked {/if}
                                                       type="checkbox" />
                                                <span class="lbl"></span>
                                            </label>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                            <button class="btn btn-xs btn-info" onclick="editTable(this,'{$vo.id}')">
                                                <i class="icon-edit bigger-120"></i>
                                            </button>

                                            <button class="btn btn-xs btn-danger" onclick="deleteTable(this,'{$vo.id}')">
                                                <i class="icon-trash bigger-120"></i>
                                            </button>

                                        </div>

                                        <div class="visible-xs visible-sm hidden-md hidden-lg">
                                            <div class="inline position-relative">
                                                <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown">
                                                    <i class="icon-cog icon-only bigger-110"></i>
                                                </button>

                                                <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
                                                    <li>
                                                        <a href="{:url('active/create')}" class="tooltip-info" data-rel="tooltip" title="View">
																				<span class="blue">
																					<i class="icon-zoom-in bigger-120"></i>
																				</span>
                                                        </a>
                                                    </li>

                                                    <li>
                                                        <a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
																				<span class="green">
																					<i class="icon-edit bigger-120"></i>
																				</span>
                                                        </a>
                                                    </li>

                                                    <li>
                                                        <a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
																				<span class="red">
																					<i class="icon-trash bigger-120"></i>
																				</span>
                                                        </a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                                <script>
                                    function editTable(obj,id){
                                        location.href="{:url('banner/update')}?id="+id;
                                    }
                                    function deleteTable(obj,id){
                                        location.href="{:url('banner/delete')}?id="+id;
                                    }
                                </script>

                                </tbody>
                            </table>
                        </div><!-- /.table-responsive -->
                    </div><!-- /span -->
                </div><!-- /row -->

                <div class="hr hr-18 dotted hr-double"></div>

                <h4 class="pink">
                    <i class="icon-hand-right icon-animated-hand-pointer blue"></i>
                    <a href="#modal-table" role="button" class="green" data-toggle="modal"> Table Inside a Modal Box </a>
                </h4>

                <div class="hr hr-18 dotted hr-double"></div>


                <div id="modal-table" class="modal fade" tabindex="-1">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header no-padding">
                                <div class="table-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        <span class="white">&times;</span>
                                    </button>
                                    列表结果
                                </div>
                            </div>

                            <div class="modal-body no-padding">
                                <table class="table table-striped table-bordered table-hover no-margin-bottom no-border-top">
                                    <thead>
                                    <tr>
                                        <th>Id</th>
                                        <th>活动名称</th>
                                        <th>活动价格</th>
                                        <th>最大参加人数</th>
                                        <th>开始日期</th>
                                        <th>结束日期</th>
                                        <th>
                                            <i class="icon-time bigger-110"></i>
                                            Update
                                        </th>
                                    </tr>
                                    </thead>

                                    <tbody>
                                    <tr>
                                        <td>
                                            <a href="#">ace.com</a>
                                        </td>
                                        <td>$45</td>
                                        <td>3,330</td>
                                        <td>Feb 12</td>
                                        <td>$45</td>
                                        <td>3,330</td>
                                        <td>Feb 12</td>
                                    </tr>


                                    </tbody>
                                </table>
                            </div>

                            <div class="modal-footer no-margin-top">
                                <button class="btn btn-sm btn-danger pull-left" data-dismiss="modal">
                                    <i class="icon-remove"></i>
                                    Close
                                </button>

                                <ul class="pagination pull-right no-margin">
                                    <li class="prev disabled">
                                        <a href="#">
                                            <i class="icon-double-angle-left"></i>
                                        </a>
                                    </li>

                                    <li class="active">
                                        <a href="#">1</a>
                                    </li>

                                    <li>
                                        <a href="#">2</a>
                                    </li>

                                    <li>
                                        <a href="#">3</a>
                                    </li>

                                    <li class="next">
                                        <a href="#">
                                            <i class="icon-double-angle-right"></i>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal-dialog -->
                </div><!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
</div><!-- /.main-content -->
<script>
   function changeValue(obj,id){
       var url = "{:url('banner/ajaxChange')}";
       var val = $(obj).attr('sx');
       if (val == 1) {
           $.post(url, {sx: val, id: id});
           $(obj).attr('sx', '0');

       } else {
           $.post(url, {sx: val, id: id});
           $(obj).attr('sx', '1');
       }
   }
</script>
<script>
    function urlTo(){
        location.href="{:url('banner/create')}";
    }
</script>

